\Rdversion{1.1}
\name{Holidays}

\alias{Holidays}
\alias{getEaster}
\alias{isEaster}
\alias{getAscension}
\alias{isAscension}
\alias{getGoodFriday}
\alias{isGoodFriday}
\alias{getEasterMonday}
\alias{isEasterMonday}
\alias{getWhiteMonday}
\alias{isWhiteMonday}

\alias{isNewYear}
\alias{isNewYearsEve}
\alias{isBerchtoldsDay}
\alias{isLabourDay}
\alias{isChristmasEveDay}
\alias{isChristmasDay}
\alias{isStStephensDay}

\alias{isSwissNationalDay}
\alias{isUKNewYear}
\alias{isUKEarlyMayBankHoliday}
\alias{isUKSpringBankHoliday}
\alias{isUKSummerBankHoliday}
\alias{isUKChristmasDay}
\alias{isUKBoxingDay}

\alias{isUnitedStatesNewYear}
\alias{isMartinLutherKingsBirthday}
\alias{isUnitedStatesPresidentsDay}
\alias{isMemorialDay}
\alias{isIndependenceDay}
\alias{isUnitedStatesLaborDay}
\alias{isThanksgiving}
\alias{isUnitedStatesChristmasDay}
\alias{isUnitedStatesBoxingDay}
\alias{isColumbusDay}
\alias{isVeteransDay}

\alias{SWISSEXCHANGE}
\alias{DEUTSCHEBOERSE}
\alias{XETRA}
\alias{EUREX}
\alias{NYSE}
\alias{USGOVERNMENTBOND}
\alias{LONDONSTOCKEXCHANGE}
\alias{BBAGBP}
\alias{BBAEUR}
\alias{BBAEUROVERNIGHT}
\alias{BBAUSD}
\alias{BBAUSDOVERNIGHT}
\alias{DEFAULTEXCHANGE}

\alias{isHoliday}
\alias{isTradingDay}
\alias{plusTradingDay}
\alias{getTradingDay}

\title{
	Holiday functions
}
\description{
	These functions generate a specific holiday date or check if the date is a holiday in a particular market.
}
\usage{
getEaster(Year)
isEaster(Date)
getAscension(Year)
isAscension(Date)
getGoodFriday(Year)
isGoodFriday(Date)
getEasterMonday(Year)
isEasterMonday(Date)
getWhiteMonday(Year)
isWhiteMonday(Date)

isNewYear(Date)
isNewYearsEve(Date)
isBerchtoldsDay(Date)
isLabourDay(Date)
isChristmasEveDay(Date)
isChristmasDay(Date)
isStStephensDay(Date)

isSwissNationalDay(Date)
isUKNewYear(Date)
isUKEarlyMayBankHoliday(Date)
isUKSpringBankHoliday(Date)
isUKSummerBankHoliday(Date)
isUKChristmasDay(Date)
isUKBoxingDay(Date)

isUnitedStatesNewYear(Date)
isMartinLutherKingsBirthday(Date)
isUnitedStatesPresidentsDay(Date)
isMemorialDay(Date)
isIndependenceDay(Date)
isUnitedStatesLaborDay(Date)
isThanksgiving(Date)
isUnitedStatesChristmasDay(Date)
isUnitedStatesBoxingDay(Date)
isColumbusDay(Date)
isVeteransDay(Date)

SWISSEXCHANGE(Date)
DEUTSCHEBOERSE(Date)
XETRA(Date)
EUREX(Date)
NYSE(Date)
USGOVERNMENTBOND(Date)
LONDONSTOCKEXCHANGE(Date)
BBAGBP(Date)
BBAEUR(Date)
BBAEUROVERNIGHT(Date)
BBAUSD(Date)
BBAUSDOVERNIGHT(Date)
DEFAULTEXCHANGE(Date)

isHoliday(Date,Exchange)
isTradingDay(Date,Exchange)
plusTradingDay(Date,nDays,Exchange)
getTradingDay(Date,Exchange="DEFAULTEXCHANGE",Direction=1,getNearest=FALSE,keepMonth=TRUE)

}

\arguments{
  \item{Year}{a vector or scalar of class numeric e.g. \code{2009:2019}}
  \item{Date}{a vector of class Date e.g. \code{Sys.Date()+0:10}}
  \item{Exchange}{the name of the Exchanges as character vector e.g. \code{c("SWISSEXCHANGE","NYSE")}}
  \item{Direction}{either 1 or -1 depending on whether the trading day is before or after the holiday}
  \item{getNearest}{either TRUE or FALSE depending on whether the function should search for the nearest trading day}
  \item{keepMonth}{either TRUE or FALSE depending on whether the next possible trading day must lie in the same month}
  \item{nDays}{the number of days}
}
%%\details{
%%  ~~ If necessary, more details than the description above ~~
%%}
\value{
	The returned value is either a scalar or vector of class Date or a scalar or vector of class logical.
%%  ~Describe the value returned
%%  If it is a LIST, use
%%  \item{comp1 }{Description of 'comp1'}
%%  \item{comp2 }{Description of 'comp2'}
%% ...
}
\references{
BBA, British Bankers' Association
\url{http://www.bbalibor.com}

Eurex Europe's Global Financial Marketplace
\url{http://www.eurexchange.com}

NYSE, New York Stock Exchange
\url{http://www.nyse.com}

London Stock Exchange
\url{http://www.londonstockexchange.com}

SIX Swiss Exchange
\url{http://www.six-swiss-exchange.com}

Deutsche Boerse, Xetra
\url{http://deutsche-boerse.com}

QuantLib: a free/open-source library for quantitative finance
\url{http://quantlib.org}

timeDate: Rmetrics - Chronological and Calendarical Objects
\url{http://stat.ethz.ch/CRAN/web/packages/timeDate}
}
\author{
Roger Bergande \email{roger@bergande.ch}
}

%\note{
%%  ~~further notes~~
%}

%% ~Make other sections like Warning with \section{Warning }{....} ~

\seealso{
	\code{
		\link{FFT}
		\link{DateYMD}
		\link{Weekdays}
	}
}
\examples{
# Examples

# Easter
getEaster(2010:2020)
isEaster(c(Sys.Date(),getEaster(year(Sys.Date()))))

# New Year
isNewYear(c(Sys.Date(),DateYMD(2020,1,1)))

# Next Martin Luther Kings Birthday
(Sys.Date()+0:364)[isMartinLutherKingsBirthday(Sys.Date()+0:364)]

# Swiss trading days
(Sys.Date()+0:364)[!SWISSEXCHANGE(Sys.Date()+0:364)]

# First trading day after holiday
getTradingDay(DateYMD(2010,1,1),c("SWISSEXCHANGE","NYSE"),Direction=1)

# Last trading day before holiday
getTradingDay(DateYMD(2010,1,1),c("SWISSEXCHANGE","NYSE"),Direction=-1)

}

\keyword{chron}
\keyword{utilities}
